# Use an official Python runtime as a parent image
FROM python

# Set the working directory in the container
WORKDIR /home/miniagent

# Copy the current directory contents into the container at /home/miniagent
COPY . /home/miniagent

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Create a group and user
RUN groupadd -r miniagent && useradd -r -g miniagent -m miniagent

# Change ownership of the files to miniagent
RUN chown -R miniagent:miniagent /home/miniagent

# Switch to the miniagent user
USER miniagent

# Run main.py when the container launches
CMD ["python", "src/main.py"]
